/**
 * 功能描述
 */

define(function(require,exports,module){
    module.exports = {
		buildingData:function(data){
			var result=[];
    		for(var i=0;i<data.length;i++){
    			var buildingObj = data[i];
    			var building = data[i].roomlist;
    			var buildingArr = [];
    			for(var j=0;j<building.length;j++){
    				var roomObj = building[j];
    				var roomData = building[j].statusList;
    				var len = roomData.length;
    				var roomArr = [];    				
    				for(var n=0;n<len;n++){
    					var stateWidth = {};
    					stateWidth.width = 100/len;
    					stateWidth.state = roomData[n].key;
    					roomArr.push(stateWidth);
    				}
    				roomObj.state = JSON.stringify(roomData);
    				roomObj.statusList = roomArr;
    				buildingArr.push(roomObj);
    			}
    			buildingObj.roomlist = buildingArr;
    			result.push(buildingObj);
    		}
    		return result;		
		}
    };
});
